

#如果没有赋值，就给这个值
PREFIX ?= ../install 
#PRJNAME = socket_tepoll
#PRJNAME = strstr
PRJNAME = socket_temp
LIBNAME = sqlitet3
LOGNAME = logger

CFLAGS  += -I ./include#-I 头文件路径 -L 动态库路径
LDFLAGS += -L ./src -lsqlite3 -lpthread -ldl -lsample -ldatabase -lcom_server -llogger -lsemaphore
RUNFLAGS += -i 127.0.0.1 -p 4444 -s ZKF0001 -t 10

all: #static_lib shared_lib
	gcc  ${PRJNAME}.c -o ${PRJNAME} ${CFLAGS} ${LDFLAGS}

#	gcc -c ${PRJNAME}.c ${CFLAGS}


static_lib:
	gcc -c sqlite3.c
	ar -rcs lib${LIBNAME}.a sqlite3.o

shared_lib:
	gcc -shared -fPIC sqlite3.c -o lib${LIBNAME}.so

LD_export:
	export LD_LIBRARY_PATH=/home/zkf/zhukaifa/socket_temp/project_1/src/

run:
	./${PRJNAME} ${RUNFLAGS}


clean:
	rm -f ${PRJNAME}.o
##	rm -f lib*.a lib*.so


#创建include存放头文件，创建lib存放静态库和动态库
install:
	cp lib*.a lib*.so ${PREFIX}/lib
	cp *.h ${PREFIX}/include

